package com.cold.datacollection.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class KafkaConfig {

    //消息主题 对应数据采集服务
    public static final String TOPIC = "cold_chain_data_collection";
    //消息主题 对应数据分析服务
    public static final String TOPIC_DRUID = "cold_chain_data_druid";

    @Bean
    public NewTopic newDataCollectionTopic(){
        return new NewTopic(TOPIC,1,(short) 1);
    }

    @Bean
    public NewTopic newDruidTopic(){
        return new NewTopic(TOPIC_DRUID,1,(short)1);
    }
}
